
<?php
$this->breadcrumbs=array(
	'Products'=>array('index'),
	$model->name,
);

$this->menu=array(
	array('label'=>'List Product', 'url'=>array('index')),
	array('label'=>'Create Product', 'url'=>array('create')),
	array('label'=>'Update Product', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete Product', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Product', 'url'=>array('admin')),
	array('label'=>'Add Pictures', 'url'=>array('productPicture/create','pid'=>$model->id)),
	array('label'=>'Edit Pictures', 'url'=>array('productPicture/admin','pid'=>$model->id)),
	
		array('label'=>'Download Pictures', 'url'=>array('productPicture/download','pid'=>$model->id)),
		array('label'=>'Upload Pictures', 'url'=>array('productPicture/upload','pid'=>$model->id)),
		array('label'=>'Form Pictures', 'url'=>array('productPicture/form','pid'=>$model->id)),
);
?>

<h1>View Product #<?php echo $model->id; ?></h1>

<?php 
//Show product detail
$this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id',
		'name',
		'description',
		'keywords',
		'status',
		'price',
		'quatity',
		'category_id',
	),
));
?>

<br>
<br>
<?php
/*
$clientScript = Yii::app()->getClientScript();

$JS_PATH = Yii::app()->baseUrl.'/protected/js';
$COLORBOX_PATH = $JS_PATH.'/colorbox';
$JQUERY_PATH = $JS_PATH;

$clientScript->registerCssFile($COLORBOX_PATH.'/css/colorbox.css','screen');

$clientScript->registerScriptFile($JQUERY_PATH.'/jquery.min.js');
$clientScript->registerScriptFile($COLORBOX_PATH.'/jquery.colorbox-min.js');
$clientScript->registerScriptFile($JS_PATH.'/colorbox-main.js');

$clientScript->registerScript('colorbox','$(document).ready(colorbox_init);');
$modelArray = $productPictureDataProvider->getData();

foreach( $modelArray as $key=> $picture ){
	?>
	<a class='gallery' href='<?php echo $picture->path; ?>'><?php echo $picture->name;?></a>
<?php
}
*/
/*$this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$productPictureDataProvider,
	'itemView'=>'/productPicture/_view',
));*/
/*$this->renderPartial('/productPicture/_view', array(
		'defaultPictureModel' => $data->productPictures[0]
));
echo $data->productPictures[0]->path;
echo $data->productPictures[1]->path;
echo $data->productPictures[2]->path;
echo $data->productPictures[3]->path;
echo $data->productPictures[4]->path;
*/
?>

<div id="galleria">

<?php

$modelArray = $productPictureDataProvider->getData();

foreach( $modelArray as $key=>$picture ){
?>
	<img height=320px src='<?php echo Yii::app()->baseUrl.$picture->path;?>'>
<?php
}
?>
</div>


<?php 
$JS_PATH = Yii::app()->baseUrl.'/protected/js';
$JQUERY_PATH = $JS_PATH;
$GALLERIA_PATH = $JS_PATH.'/galleria';

$cs = Yii::app()->getClientScript();
$cs->registerScriptFile($JQUERY_PATH.'/jquery.min.js');
$cs->registerScriptFile($GALLERIA_PATH.'/galleria-1.2.7.min.js');
$cs->registerScriptFile($GALLERIA_PATH.'/themes/classic/galleria.classic.min.js');
$cs->registerScriptFile($JS_PATH.'/galleria-main.js');
$cs->registerScript('galleria','galleriaRun();',CClientScript::POS_READY);
?>

